package mobi.hami.huapin.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import mobi.hami.huapin.base.Result;
import mobi.hami.huapin.constants.BaseEnums;
import mobi.hami.huapin.service.CreateNoteAuditService;
import mobi.hami.huapin.service.NoteScheduleService;
import mobi.hami.huapin.util.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 纸条排期（前台使用）
 *
 * @author 阿飞 jijunjian@hami.mobi
 * @date 2018/9/18 10:43
 */
@RestController
@RequestMapping(value = "/noteschedule",produces = "application/json")
@Api(description = "纸条排期（小程序显示）")
public class NoteScheduleController {

    @Autowired
    NoteScheduleService noteScheduleService;

    @RequestMapping(value = "/getlistforuser.do", method = RequestMethod.POST)
    @ApiOperation(value = "前台获取纸列表", notes = "{\n" +
            "  \"userid\": \"会员编号\",\n" +
            "  \"spaceid\": \"空间编号\"\n" +
            "}")
    @ApiResponses({
            @ApiResponse(code = 200,message = "{\n" +
                    "  \"success\": true,\n" +
                    "  \"code\": \"request.success\",\n" +
                    "  \"msg\": \"请求成功\",\n" +
                    "  \"data\": true  true表示成功，否则失败\n" +
                    "}")
    })
    public Result add(@RequestBody Map<String, String> reqMap) {

        return Results.successWithData(noteScheduleService.getUserNoteWithCommon(reqMap), BaseEnums.SUCCESS.code(), BaseEnums.SUCCESS.desc());

    }
}
